'use strict';
const db = uniCloud.database()
const dbCmd = db.command
exports.main = async (event, context) => {
	//event为客户端上传的参数
	const { mysize1=1 } = event
	
		let listData = await db.collection("videos")
	    .aggregate()
		.sample({
			size:mysize1
		})
		.end()
		
		// console.log(listData2,'listData2listData2');
	//返回数据给客户端
	return {
		status: 200,
		msg: '查询成功',
		data:listData.data
		}
};
